<?php
/**
 * Created by PhpStorm.
 * User: yekong
 * Date: 2018/3/7
 * Time: 上午11:24
 */
/*
$arr = array(
    130,131,132,133,134,135,136,137,138,139,
    144,147,
    150,151,152,153,155,156,157,158,159,
    176,177,178,
    180,181,182,183,184,185,186,187,188,189,
);
$money = array(100, 300, 500, 800);
for($i = 0; $i < 100; $i++) {
    $tmp[] =  $arr[array_rand($arr)].' '.mt_rand(1000,9999).' '.mt_rand(1000,9999);
}
//print_r(array_unique($tmp));
echo "<pre>".print_r(array_unique($tmp))."</pre>";
*/
echo "hello word";






//public function wa(){
//    $answer = array('你好', '你是傻逼吗', '你怎么什么都不会', '1+1等于多少?', '我是你爸爸', '滚滚滚');


$answer = array('好个jb', '你是傻逼吗', '你怎么什么都不会', '1+1等于多少?', '我是你爸爸', '滚滚滚');
$answer_好 = array('好个jb', '好你mb', '劳资一点都不好', '滚滚滚');
$answer_滚 = array('你丑你先滚');
$answer_傻 = array('你个傻b再说一次');
$answer_日 = array('来啊');
$answer_what = array('我怀疑你是条哈士奇');

$say = $_POST['say'];//获取说的话

$answer['all'] = array('好个jb', '你是傻逼吗', '你怎么什么都不会', '1+1等于多少?', '我是你爸爸', '滚滚滚');
$answer['好'] = array('好个jb', '好你mb', '劳资一点都不好', '滚滚滚');
$answer['滚'] = array('你丑你先滚');
$answer['傻'] = array('你个傻b再说一次');
$answer['日'] = array('来啊');
$answer['草'] = array('我怀疑你是条哈士奇');

$say = $_POST['say'];

$key = array('好', '滚', '傻', '日', '草');

foreach($key as $val){
    if(false !== strpos($say, $val)){
        exit(json_encode(array('answer' => array_rand($answer[$val]))));
    }
}






/*
$x=5;
$y=6;
$z=$x+$y;
echo "<br>";
echo $z;
*/
//echo "<br>";
//function myTest()
//{
//    static $x=0;
//    if ($x==0){
//        echo $x;
//    }else{
//        echo "/$x";
//    }
//    $x++;
//}
//
//myTest();
//myTest();
//myTest();


